//
//  LQYBottomToolView.m
//  FAKER
//
//  Created by dllo on 15/11/6.
//  Copyright © 2015年 YHLai. All rights reserved.
//

#import "LQYBottomToolView.h"
#import "FitHeader.h"
@implementation LQYBottomToolView

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        _bottomToolsView = [[UIView alloc]init];
        [self addSubview:_bottomToolsView];
        
        _lineLabel = [[UILabel alloc]init];
        _lineLabel.backgroundColor = [UIColor colorWithRed:0.89 green:0.89 blue:0.9 alpha:1];
        [self addSubview:_lineLabel];
        
        _backButton = [UIButton buttonWithType:UIButtonTypeSystem];
        UIImage *backImage = [UIImage imageNamed:@"common_icon_return@2x"];
        backImage = [backImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        [_backButton setImage:backImage forState:UIControlStateNormal];
        [_backButton addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_backButton];
    }
    return self;
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _bottomToolsView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 40);
    _backButton.frame = CGRectMake(20 * FITWIDTH, _bottomToolsView.Y + 5 * FITHEIGHT, 30 * FITWIDTH, 30 * FITHEIGHT);
    _lineLabel.frame = CGRectMake(0, _bottomToolsView.Y - 1 * FITHEIGHT, SCREEN_WIDTH, 1 * FITHEIGHT);
}
-(void)buttonAction
{
    [self.backDelegate backToPresentViewController];
}

@end
